Skip to content

DFSDM#614

Open
oganigl wants to merge 58 commits intodevelopmentfrom
feat/DFSDM
Open

DFSDM#614
oganigl wants to merge 58 commits intodevelopmentfrom
feat/DFSDM

Conversation

@oganigl
Copy link
Copy Markdown
Contributor

@oganigl oganigl commented Mar 26, 2026

DFSDM module finished and tested. Only missing try in the hyperNucleo

oganigl and others added 30 commits January 28, 2026 18:09
…es of the DMA without removing double entries with the dfsdm.
* Fixed copy pointers leading with possible missalignment

* fix(tcp): handle fragmented order streams and queue backpressure

* fix(server): own and recycle ServerSocket instances safely

* fix(udp): harden DatagramSocket lifecycle and pbuf parsing

* fix(lwip): align ICMP checksum settings with hw offload

* fix(net): harden socket teardown and unify TCP order parsing

* Applied formatter

* perf(net): benchmark-driven TCP TX fast path

* feat(error): decouple transport from legacy update

* Modified warning to decouple from protections

* Better timestamp in error and warning

* Protection manager more robust

* Always enqueuing msgs even when there are no sockets

* sorry, I forgot one file

* SNTP set

* minor fix on protections

* Being able to compile without ehternet

* formatter
* Prescaler was not initialized in init

* formatting: Remove spaces

* formatting

* hardened a lot the encoder, being sure that instances are properly set

* minor fix, not setting properly the encoder start

* added tests for the encoder

* reverted nullptr checks, and made builder private

* applied formatter

* Make constructors private in Encoder, PWM, DualPWM

* applied formatter

* fixed merge mess

---------

Co-authored-by: Víctor López <120128034+victor-Lopez25@users.noreply.github.com>
Co-authored-by: Jorge Sáez <jorgeesg82@gmail.com>
* Scheduler now "reserves" a timer from timerdomain

* Also remove possibility of getting scheduler timer from bits32_timers

* stupid change to get precommit to work (?)

* fix formatting (?)

* more format fix

* fix segfault in tests (?)

* fix formatting

* move Scheduler_global_timer in scheduler_test.cpp
* Fixed issues with MSVC on windows

* Move implementation into cpp

* Return to inlining clz and ctz

* fix formatting (hopefully)

* more formatting fixes

* fix formatting final please
* Fix: rcc_enable_timer for scheduler timer

* formatting nº1
* No more fixed_vector(idk why I did that)

* First version implementing std::tupple

* No more copy constructor bullshit

* Equal operator fixed, now it compiles

* Compiling version, tests to be done

* Okay now we check for duplicates

* Some formating changes

* Clanker made me do this so the start and exit functions stop when the condition is true

* Made nesting consteval

* Fix short circuit no use on return warning

* Added state machine tests

* Formating errors fixed

* Ok now format errors are fixed

* More tests need to be addes

* Compile testing added, as well as reduced task array to only allow 16 task

* Formating errores fixed

* Delete tests for the tests

* Now you cant use state machine without start

* Fixed logic for nested machine start

* Formating error fix

* clanker commit

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Now we use a concept for a correct tuple in state machine helper function

* Formating fix

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@oganigl oganigl linked an issue Mar 26, 2026 that may be closed by this pull request
@jorgesg82 jorgesg82 changed the title Development DFSDM Mar 27, 2026
@jorgesg82
Copy link
Copy Markdown
Contributor

@claude review

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

ST-LIB Release Plan

  • Current version: 5.0.0
  • Pending changesets: 5
  • Highest requested bump: minor
  • Next version if merged now: 5.1.0

Pending changes

  • minor Refactor the ADC stack around DMA-backed acquisition using new MPU (.changesets/adc-dma-minor.md)
  • minor Added module dfsdm tested (.changesets/dfsdm-module-minor.md)
  • patch Fix incorrect GPIO alternate-function availability bitmaps (.changesets/gpio-af-bitmaps-patch.md)
  • minor input capture implementation (.changesets/inputcapture.md)
  • none Introduce semver tooling and release automation infrastructure (.changesets/revive-releases-bootstrap.md)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new DFSDM (Digital Filter for Sigma-Delta Modulators) service/domain and wires it into the ST-LIB board build/init pipeline (including DMA integration and IRQ handlers), plus supporting updates to timer trigger configuration and mocks.

Changes:

  • Introduces DFSDM_CHANNEL_DOMAIN and DFSDM_CLK_DOMAIN, plus DFSDM IRQ handlers and build-time DMA contributions.
  • Extends DMA + mocked HAL definitions to support DFSDM filter DMA requests and richer TIM TRGO/TRGO2 options.
  • Minor build/tooling updates (Linux STM32CubeCLT path globbing, small formatting cleanup, changeset entry).

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
toolchains/stm32.cmake Makes Linux STM32CubeCLT discovery more case-insensitive via glob patterns.
Src/HALAL/Services/DFSDM/DFSDM.cpp Adds DFSDM filter IRQ handlers that forward to DFSDM domain IRQ dispatcher.
Inc/HALAL/Services/DFSDM/DFSDM.hpp New DFSDM domains: config/build logic, DMA contribution helpers, runtime instances, and IRQ dispatch.
Inc/ST-LIB_LOW/ST-LIB_LOW.hpp Exposes DFSDM header through the low-level umbrella include.
Inc/ST-LIB.hpp Registers DFSDM domains in DomainsCtx, adds DFSDM config building, DMA merging, and init wiring.
Inc/MockedDrivers/stm32h7xx_hal_mock.h Adds DFSDM DMA request IDs and expands TIM TRGO/TRGO2 constants for simulation.
Inc/HALAL/Services/ADC/ADC.hpp Constructor formatting change only.
Inc/HALAL/Models/TimerDomain/TimerDomain.hpp Adds TRGO/TRGO2 selection to timer entries/configs and applies master sync configuration.
Inc/HALAL/Models/Pin.hpp Updates pin metadata bitfields for several pins used by DFSDM/timers.
Inc/HALAL/Models/DMA/DMA2.hpp Adds DFSDM DMA peripherals and request mapping; tweaks alignment handling for DFSDM.
Inc/HALAL/HALAL.hpp Includes DFSDM service header in HALAL umbrella.
CMakeLists.txt Adds DFSDM.cpp to the HALAL source list.
.changesets/dfsdm-module-minor.md Declares a minor release changeset for DFSDM addition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1155 to +1160
static void handle_irq(uint8_t filter_index) {

DFSDM_Filter_TypeDef* filter = filter_hw[filter_index];

uint32_t isr = filter->FLTISR;

Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DFSDM module introduces substantial new logic (compile-time config building, DMA contributions, and IRQ dispatch in handle_irq) but there are no corresponding unit tests under Tests/ (the repo already uses googletest for ADC/DMA/SPI). Adding at least a simulation test covering config validation and IRQ channel decoding would help prevent regressions.

Copilot uses AI. Check for mistakes.
oganigl and others added 9 commits April 1, 2026 20:08
- Added clock domain pin validation tests
- Added clock domain alternate function mapping tests
- Added clock domain constructor validation
- All 22 DFSDM tests now passing
- Both simulator and nucleo-debug presets compile with 0 errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DFSDM Domain

6 participants